﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Surface.Core;
using Microsoft.Surface.Core.Manipulations;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

namespace SurfaceApplication3
{
    class Menu
    {
        private List<MenuItem> menuItems;
        private Texture2D texture;
        private Vector2 position;
        private Vector2 size;
        private Vector2 origin;
        private float rotation;

        public Menu(Texture2D texture, Vector2 position, Vector2 origin)
        {
            this.texture = texture;
            rotation = 0;
            size = new Vector2(180, 25);
        }

        /*
         * TO DO implementing menu list with scroll bar functionality
         * SurfaceCoreFramework library could be used 
         */
        public void Draw(SpriteBatch spriteBatch)
        {
            foreach (MenuItem item in menuItems)
            {
                spriteBatch.Draw(item.Texture, item.Position, null, Color.White, item.Rotation, item.Origin, 1, SpriteEffects.None, 1);
            }
        }
        // add item at the end of the list
        public void AddItem(MenuItem aItem)
        {
            menuItems.Add(aItem);
        }

        // insert an item item at a specified index
        public void Insert(int index, MenuItem aItem)
        {
            menuItems.Insert(index, aItem);
        }

        #region set/get functions
        public Vector2 Position
        {
            get { return position; }
            set { position = value; }
        }

        public Vector2 Origin
        {
            get { return origin; }
            set { origin = value; }
        }

        public float Rotation
        {
            get { return rotation; }
            set { rotation = value; }
        }
        #endregion
    }
}

